<%@page contentType="text/html"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'teste.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<f:view>
		<body>
		<f:subview id="subview1">
			<jsp:include page="menu.jsp"></jsp:include>
		</f:subview>
			<h:form>
				<rich:panel>
					<a4j:commandButton ajaxSingle="true" id="insertlink" value="Cadastrar Usuario"
					
					oncomplete="#{rich:component('insertUsuarioPanel')}.show()"></a4j:commandButton>
					
					
				</rich:panel>
				
				<rich:modalPanel id="insertUsuarioPanel" autosized="true" width="550">
	    	<f:facet name="header">
				<h:outputText value="Cadastro de Usuario" />
			</f:facet>
			<f:facet name="controls">
				<h:panelGroup>
					<h:graphicImage value="/images/modal/close.png" id="hidelink5"
						styleClass="hidelink" />
					<rich:componentControl for="insertUsuarioPanel"
						attachTo="hidelink5" operation="hide" event="onclick" />
				</h:panelGroup>
			</f:facet>
		    	<h:form>
		    		<rich:panel>
			    		<h:panelGrid columns="2">
			    			<h:outputText value="Nome:"></h:outputText>
					    	<h:inputText value="#{manterUsuario.currentItem.nome}" size="50" ></h:inputText>
				    	
			    	    <h:outputText value="Data de Nasc.:"></h:outputText>
				    	<h:inputText value="#{manterUsuario.currentItem.dataNasc}" size="50">
				    	</h:inputText>
				    	
				    	<h:outputText value="Email:"></h:outputText>
				    	<h:inputText value="#{manterUsuario.currentItem.email}" size="50">
				    	</h:inputText>
				    	
				    	<h:outputText value="Login:"></h:outputText>
				    	<h:inputText value="#{manterUsuario.currentItem.usuario}" size="50">
				    	</h:inputText>
				    	
				    	<h:outputText value="Senha:"></h:outputText>
				    	<h:inputText value="#{manterUsuario.currentItem.senha}" size="50" >
				    	</h:inputText>
			    	</h:panelGrid>
				    	
				    				    	
				    	<h:panelGrid columns="1">
				    	<h:outputText></h:outputText>
				    	</h:panelGrid>
				    	
				    	<rich:separator></rich:separator>
				    	
				    	<h:panelGrid columns="1">
				    	<h:outputText></h:outputText>
				    	</h:panelGrid>
				    	
				    				    	
				    	<a4j:commandButton action="#{manterUsuario.save}" reRender="rpanel" value="Salvar"
				    	oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('insertUsuarioPanel')}.hide();"/>
				    	<a4j:commandButton action="#{manterUsuario.clean}" reRender="rpanel" value="Cancelar"
				    	onclick="#{rich:component('insertUsuarioPanel')}.hide();return false;"/>
				    </rich:panel>
		    	</h:form>
    	</rich:modalPanel>
			</h:form>
		</body>
	</f:view>
</html>
